package cn.javastack.springboot.knife4j.web;


import cn.javastack.springboot.knife4j.dto.CityResDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.extensions.Extension;
import io.swagger.v3.oas.annotations.extensions.ExtensionProperty;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@RestController
@RequestMapping("/hub/example/city")
@Slf4j
@Api(tags = "城市信息获取服务")
public class CityController {
    @ApiOperation(value = "使用城市编码获取信息接口",
            notes = "使用城市编码获取信息"
    )
    @GetMapping("/queryByCityId")
    public CityResDTO queryByCityId(String cityId) {
        CityResDTO cityResDTO = new CityResDTO();
        cityResDTO.setCityDescribe("杭州是一个互联网城市");
        cityResDTO.setCityName("杭州");
        return cityResDTO;
    }

    @ApiOperation(value = "使用城市编码和名称获取信息接口",
            notes = "使用城市编码和城市名称获取信息"
    )
    @PostMapping("/queryByCity")
    public CityResDTO queryByCity(String cityId) {
        CityResDTO cityResDTO = new CityResDTO();
        cityResDTO.setCityDescribe("杭州是一个互联网城市");
        cityResDTO.setCityName("杭州");
        return cityResDTO;
    }
    @ApiOperation(value = "使用城市名称获取信息接口",
            notes = "使用城市名称获取信息",
            extensions = {}
    )
    @GetMapping("/queryByCityName")
    public CityResDTO queryByCityName(String cityName) {
        CityResDTO cityResDTO = new CityResDTO();
        cityResDTO.setCityDescribe("杭州是一个互联网城市");
        cityResDTO.setCityName("杭州");
        return cityResDTO;
    }
}
